<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Taco cloud</title>
</head>
<body>
    <form method="post" th:object="${order}" th:action="@{/orders}">
        <h1>Order your taco creations!</h1>
        <img th:src="@{/images/TacoCloud.png}"/>
        <a th:href="@{/design}" id="another">Design another taco</a>

        <div th:if="${#fields.hasErrors()}">
            <span class="validationError">
                Please correct the problems below and resubmit
            </span>
        </div>

        <h3>Deliver my taco masterpieces to...</h3>
        <label for="name">Name: </label>
        <input type="text" th:field="*{name}"/>
        <span class="validationError" th:if="${#fields.hasErrors('name')}" th:errors="*{name}"
        >Name error</span>
        <br/>

        <label for="street">Street: </label>
        <input type="text" th:field="*{street}"/>
        <span class="validationError" th:if="${#fields.hasErrors('street')}" th:errors="*{street}"
        >street error</span>
        <br/>
        <label for="city">City: </label>
        <input type="text" th:field="*{city}"/>
        <span class="validationError" th:if="${#fields.hasErrors('city')}" th:errors="*{city}"
        >city error</span>
        <br/>

        <label for="state">state: </label>
        <input type="text" th:field="*{state}"/>
        <span class="validationError" th:if="${#fields.hasErrors('state')}" th:errors="*{state}"
        >state error</span>
        <br/>

        <label for="zip">zip: </label>
        <input type="text" th:field="*{zip}"/>
        <span class="validationError" th:if="${#fields.hasErrors('zip')}" th:errors="*{zip}"
        >zip error</span>
        <br/>

        <label for="ccNumber">ccNumber: </label>
        <input type="text" th:field="*{ccNumber}"/>
        <span class="validationError" th:if="${#fields.hasErrors('ccNumber')}" th:errors="*{ccNumber}"
        >ccNumber error</span>
        <br/>

        <label for="ccException">ccException: </label>
        <input type="text" th:field="*{ccException}"/>
        <span class="validationError" th:if="${#fields.hasErrors('ccException')}" th:errors="*{ccException}"
        >ccException error</span>
        <br/>

        <label for="ccCVV">ccCVV: </label>
        <input type="text" th:field="*{ccCVV}"/>
        <span class="validationError" th:if="${#fields.hasErrors('ccCVV')}" th:errors="*{ccCVV}"
        >ccCVV error</span>
        <br/>

        <input type="submit" value="submit order">
    </form>
</body>
</html>